class Solution:
    def hIndex(self, citations) -> int:
        n = len(citations)
        for i in range(n):
            if citations[i] >= (n - i):
                return n - i
        return 0


if __name__ == '__main__':
    so = Solution()
    m = [0,1,3,5,6]
    r = so.hIndex(m)
    print(r)
